package com.isoft.service.tableservice;


import com.isoft.dao.tabledao.BaseApueDao;
import com.isoft.entity.tableentity.base_apue.BaseApueMsg;
import com.isoft.utils.TimeFormatUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Timestamp;
import java.text.ParseException;

@Slf4j
@Service
public class BaseApueService {
    @Autowired
    private BaseApueDao baseApueDao;
    @Transactional
    public int insertmsg(BaseApueMsg baseApueMsg) throws ParseException {
        Timestamp ddtm= TimeFormatUtils.stringToTimestamp(baseApueMsg.getBaseApueMeta().getDdtm());
        Timestamp create_time=TimeFormatUtils.GetNowTime();
        baseApueDao.insertMeta(create_time,ddtm, baseApueMsg.getBaseApueMeta());
        return baseApueDao.insertApot(baseApueMsg.getBaseApueMeta().getSeqn(),create_time, baseApueMsg.getApot());
    }
}
